<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/skin/css/amazeui.min1.css" />
<link href="/user/css/style.css?v=2.14" rel="stylesheet" type="text/css" />
<script src="/skin/js/jquery.js"></script>
<script src="/skin/js/clipboard.min.js"></script>
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<title>素材分享-{$sys[webname]}</title>
</head>
<body class="body">
<div class="">
	<header id="header">
	<section class="head-b head-b1">
		<span class="u-left"><a href="javascript:history.go(-1);" class="back"><img src="/skin/img/back.png"/></a></span>
		<h1 id="t0">{$info[name]}</h1>
		<div class="u-right" href="#">
			<a href="/" class="hSearch right"><img src="/skin/img/i_home.png"/></a>
		</div>
	</section>
</header>
<div class="menu1">
<ul class="">
    {loop $menu $key as $list}
    <li
    {if($cid==$list['Id'])} class="on" {/if}
    >
        <a href="newslist.php?cid={$list[Id]}">{$list[name]}</a>
    </li>
    {/loop}
</ul>
</div>
	<div class="" style='margin-top:5px;'>
{if($msg==1)}
	<ul class="downUl">
		{loop $nlist $key as $list}
		<li>
            <div class="downTit">
                <h3>{$list[title]}</h3>
                <span>保存素材</span>
            </div>
            <div class="content">
                {$list[content]}
            </div>
			<div class="pic">
				{$pic = $list['pic1']}
				{for $pic $i}
				<img src='{$pic[$i]}'  />
				{/for}
			</div>
		</li>
		{/loop}
	</ul>
{$page}
{else}
<p class='none'>暂无信息</p>
{/if}
	</div>	
</div>
<div>

</div>
<div class="copyCj">
    <textarea id="foo" value=""></textarea>
    <button class="btn" data-clipboard-target="#foo"></button>
</div>
<div class="copyTishi" style='display:none;'>

</div>
<div class="tishiBg"></div>
<div class="tcpic">
    <span class="close"></span>
    <img src="" alt="">
</div>
<script>
    $(".downTit span").click(function () {
       $(this).closest("li").find(".pic img").each(function (index) {
           const a = document.createElement('a');
           a.href = $(this).attr('src');
           a.download = `image${index}.jpg`; // 可以根据需要自定义文件名
           document.body.appendChild(a);
           a.click(); // 模拟点击以开始下载
           document.body.removeChild(a);
       });
       let atxt = $(this).closest("li").find(".content").text();
        $('#foo').val(atxt);
        $(".btn").click();
    });
    var clipboard = new ClipboardJS('.btn');
    clipboard.on('success', function() {
        $(".copyTishi").html(`<img src="/skin/img/success.png" /><p>复制成功</p>`);
        tishi();
    });
    clipboard.on('error', function() {
        $(".copyTishi").html(`<img src="/skin/img/error.png" /><p>复制失败 请手动复制</p>`);
        tishi();
    });

    function tishi() {
        $(".copyTishi").show();
        $(".tishiBg").show();
        setTimeout(function () {
            $(".copyTishi").hide();
            $(".tishiBg").hide();
        },2000);
    }
    $(".pic img").click(function () {
       let asrc = $(this).attr('src');
       $(".tcpic").attr('style','display:flex');
        $(".tcpic img").attr('src',asrc);
    });
   $(".tcpic .close").click(function () {
     $(".tcpic").hide();
   });
</script>


{include(foot)}
</body>
</html>